package com.balance.pojo.sys;

import com.balance.pojo.common.CommonPojo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.sql.Date;
import java.util.List;

/**
 * @Title: SysUser
 * @Author 小东
 * @Package com.balance.pojo
 * @Date 2025/3/27 17:37
 * @description: 系统用户
 */
@TableName("sys_user")
public class SysUser extends CommonPojo implements Serializable {
    private static final long serialVersionUID = 1L;
    private Integer id;
    private String username;
    private String password;
    private String salt;
    private String realName;
    private String avatar;
    private String email;
    private String mobile;
    private Integer status;
    private Integer deptId;
    private Date lastLoginTime;
    private Date lastLoginIp;

    @TableField(exist = false)
    private Date lastLoginStartTime;

    @TableField(exist = false)
    private Date lastLoginEndTime;

    // 关联角色列表（非数据库字段）
    @TableField(exist = false)
    private List<SysRole> roles;

    public SysUser() {
    }

    public SysUser(String username, String password, String realName, String mobile) {
        this.username = username;
        this.password = password;
        this.realName = realName;
        this.mobile = mobile;
    }

    @Override
    public String toString() {
        return "SysUser{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", realName='" + realName + '\'' +
                ", avatar='" + avatar + '\'' +
                ", email='" + email + '\'' +
                ", mobile='" + mobile + '\'' +
                ", status=" + status +
                ", deptId=" + deptId +
                ", lastLoginTime=" + lastLoginTime +
                ", lastLoginIp=" + lastLoginIp +
                ", lastLoginStartTime=" + lastLoginStartTime +
                ", lastLoginEndTime=" + lastLoginEndTime +
                ", roles=" + roles +
                '}';
    }

    public Date getLastLoginStartTime() {
        return lastLoginStartTime;
    }

    public void setLastLoginStartTime(Date lastLoginStartTime) {
        this.lastLoginStartTime = lastLoginStartTime;
    }

    public Date getLastLoginEndTime() {
        return lastLoginEndTime;
    }

    public void setLastLoginEndTime(Date lastLoginEndTime) {
        this.lastLoginEndTime = lastLoginEndTime;
    }

    public List<SysRole> getRoles() {
        return roles;
    }

    public void setRoles(List<SysRole> roles) {
        this.roles = roles;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }


    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(Date lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }
}
